<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>商品评价</title>
    <script src="__INDEX__/js/mui.min.js"></script>
    <link href="__INDEX__/css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
    <link rel="stylesheet" href="__INDEX__/css/style.css" />
    <link rel="stylesheet" href="__INDEX__/css/yund.css" />
</head>

<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		<h1 class="mui-title">订单</h1>
	</header>		
	<form id='my_form' method="post" class="layui-form">
	<div class="mui-content">
		<div class="order_listbox">
			<div class="order_item">
				<div class="order_zt clearfix" style="padding:3%">
					<div class="left"><span class="iconfont icon-shangcheng"></span>{$order_info['agent_name']}</div>
					<div class="right">
						{:get_order_type($order_info['status'])}
					</div>
				</div>
				<div class="order_zt clearfix" style="padding:10px">
					<div class="left" style="width: 100%;">订单编号：{$order_info['order_sn']}</div>
				</div>
				<ul class="order_item_list">
					<li>
						<div class="order_item_spimg"><img src="{$order_info['order_item']['thumb']}" style="width: 6.5rem;height: 6.5rem;"></div>
						<div class="order_item_spinfo">
							<div class="order_itspnam">{$order_info['order_item']['goods_name']}</div>
							<div class="order_isp_b clearfix">
								<span class="ord_pribox">
									<em class="pri">¥{$order_info['order_item']['price']}</em>
									<em class="yj">¥{$order_info['order_item']['sale_price']}</em>
								</span>
								<span class="pay_spnum">X{$order_info['order_item']['nums']}</span>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
		<div class="layui-form-item" style="background-color: #fff;">  
		    <label class="layui-form-label" style="font-size:16px;line-height: 50px;width: 30%;text-align: left;">快递评分:</label>
		    <div class="layui-input-block">
		    	<input type="radio" name="express_score" value="5" title="5分" checked>
		    	<input type="radio" name="express_score" value="4" title="4分">
		    	<input type="radio" name="express_score" value="3" title="3分">
		    	<input type="radio" name="express_score" value="2" title="2分" >
		      	<input type="radio" name="express_score" value="1" title="1分">
		    </div>
		</div>
		<div class="layui-form-item" style="background-color: #fff;">  
		    <label class="layui-form-label" style="font-size:16px;line-height: 50px;width: 30%;text-align: left;">服务评分:</label>
		    <div class="layui-input-block">
		    	<input type="radio" name="service_score" value="5" title="5分" checked>
		    	<input type="radio" name="service_score" value="4" title="4分">
		    	<input type="radio" name="service_score" value="3" title="3分">
		    	<input type="radio" name="service_score" value="2" title="2分" >
		      	<input type="radio" name="service_score" value="1" title="1分">
		    </div>
		</div>
		<div class="layui-form-item" style="background-color: #fff;">  
		    <label class="layui-form-label" style="font-size:16px;line-height: 50px;width: 30%;text-align: left;">商品评分:</label>
		    <div class="layui-input-block">
		    	<input type="radio" name="goods_score" value="5" title="5分" checked>
		    	<input type="radio" name="goods_score" value="4" title="4分">
		    	<input type="radio" name="goods_score" value="3" title="3分">
		    	<input type="radio" name="goods_score" value="2" title="2分" >
		      	<input type="radio" name="goods_score" value="1" title="1分">
		    </div>
		</div>
		<div class="layui-form-item layui-form-text">
		    <label class="layui-form-label" style="width: 100%;text-align: left;font-size: 16px; font-weight: bold;">订单评价：</label>
		</div>
		<div class="layui-form-item layui-form-text">
		    <div class="layui-input-block" style="margin-left: 5px;margin-right: 5px;">
		      <textarea name="content" placeholder="请输入内容" class="layui-textarea" style="min-height: 135px;"></textarea>
		    </div>
		</div>
		<div class="layui-form-item">
		    <div class="layui-input-block">
		      <button class="layui-btn" id='change_but' lay-submit lay-filter="formDemo">立即提交</button>
		      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>
	</div>
	<input type="hidden" name="goods_id" value="{$order_info['order_item']['goods_id']}">
	<input type="hidden" name="order_id" value="{$order_info['order_item']['order_id']}">
	<input type="hidden" name="agent_id" value="{$order_info['agent_id']}">
	<input type="hidden" name="goods_name" value="{$order_info['order_item']['goods_name']}">
	</form>
</body>
</html>
{include file="public/footer" /}
<script>
	layui.use('form', function(){
  	var form = layui.form;
	//监听提交
	form.on('submit(formDemo)', function(data){
		$('#change_but').addClass("layui-btn-disabled");
		
		set_content();
		
	    return false;
	});
})
	//提交表单
	function set_content(){
		 $.ajax({
	         	type:"post",
	            url:"{:url('shop/order_comment')}",
	            data: $('#my_form').serialize(),//表单数据
	            success:function(data){
	               layer.msg(data.msg, {
						  icon: 1,
						  time: 1500 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							if(data.code == 200){
								location.href = data.url;
							}else{
								location.reload();
							}
					});
	            }
	    });
	}
</script>